package com.设计模式.代理模式.动态代理.JDK动态代理;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/3/1  13:49
 * 描述:
 */
public class MyInvocationHandler implements InvocationHandler {

    private TestDaiLiInterface testDaiLiInterface;

    public MyInvocationHandler(TestDaiLiInterface testDaiLiInterface) {
        this.testDaiLiInterface = testDaiLiInterface;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("=========之前======");
        Object invoke = method.invoke(testDaiLiInterface);
        System.out.println("=========之前======");

        return invoke;
    }
}
